package com.swak.vertx.protocol.http.adapter;

import java.util.concurrent.CompletionStage;

import com.swak.vertx.protocol.http.ParamParser;

/**
 * 参数解析
 * 
 * @author DELL
 */
public class ParamParseAdapter extends AbstractAdapter {
	private ParamParser paramParser;

	public ParamParseAdapter(ParamParser paramParser) {
		this.paramParser = paramParser;
	}

	@Override
	public CompletionStage<Context> handle(Context context) {
		context.$result = this.paramParser.parseParameters(context.$context, context.$method);
		return this.next(context);
	}

}